package com.nutricia.common.api.enums;

/**
 * 用户状态枚举
 *
 * @author: huangsheng
 * @date: 2017/10/25
 */
public enum UserStateEnums {

    /**
     * 禁用
     */
    DISABLE("01", "禁用"),

    /**
     * 启用
     */
    ENABLE("00", "启用");

    UserStateEnums(String key, String value) {
        this.key = key;
        this.value = value;
    }

    private String key;
    private String value;

    public String getKey() {
        return key;
    }

    /**
     * 判断数值是否属于枚举类的值
     *
     * @param key
     * @return false or true
     */
    public static boolean isInclude(String key) {
        boolean include = false;
        for (UserStateEnums pointTypeEnum : UserStateEnums.values()) {
            if (pointTypeEnum.getKey().equals(key)) {
                include = true;
                break;
            }
        }
        return include;
    }
}

